package GameElements.Elements;

import java.util.Vector;

import GameBoard.GameBoard;
import GameElements.Tile;
import Utils.Point3D;

public class Castle extends Element
{	
	public Castle(Vector<Tile> ensTile, Vector<Point3D> chemin) 
	{
		this.ensTile = ensTile;
		this.chemin = chemin;
		scoreDonneInComplete = scoreInCastle();
		System.out.println("castle complete");
	}

	protected int scoreInCastle()
	{
		int s = ensTile.size() * 2;
		for(int i=0;i<ensTile.size();i++)
			if(ensTile.get(i).haveBouclier())
				s = s+2;
		return s;
	}
	
	@Override
	public int getType() 
	{
		return Tile.castle;
	}

	@Override
	public Vector<Tile> getEnsTileContentPawn(Tile[][] table) {
		Vector<Tile> ensTileContentPawn = new Vector<Tile>();
		for(int i=0; i<chemin.size(); i++)
		{
			Point3D p = chemin.get(i);
			Tile t = table[p.x][p.y];
			if(t.getPawn(p.z) != null)
				ensTileContentPawn.add(t);
		}
		return ensTileContentPawn;
	}

}
